<template>
  <div>
    <ul>
      <li v-for="m in messageList" :key="m.id">
        <!--第一种写法——字符串 -->
        <!-- <router-link :to="`/home/message/detail/${m.id}/${m.title}/${m.content}`">
          {{m.title}}
        </router-link> -->

        <router-link 
          :to="{
            name:'xiangqing',
            query:{
              content:m.content,
              title:m.title,
              id:m.id,
            },
            params:{
              school:'尚硅谷'
            }
          }"
        >
          {{m.title}}
        </router-link>
      </li>
    </ul>
    <div class="panel panel-body panel-primary">
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
  export default {
    name:'Message',
    data() {
      return {
        messageList:[
          {id:'dadsrt1',title:'《两男子竟然做了这种事》',content:'竟然很晚了还在学习！'},
          {id:'dadsrt2',title:'《李晶老师竟然背着媳妇做了这种事》',content:'很晚了还在红浪漫二楼'},
          {id:'dadsrt3',title:'《强哥竟然花了很多钱买彩票》',content:'一次都没中'}
        ]
      }
    },
  }
</script>